import {request} from '@/utils/request'


// 商品列表
export function productList(data) {
    return request({
        url: '/product/admin_list',
        method: 'get',
        data
    })
}



export function pCategoryList(data) {
    return request({
        url: '/pcategory/list',
        method: 'get',
        data
    })
}

export function updateProduct(data) {
    return request({
        url: '/product/update',
        method: 'post',
        data
    })
}

export function orderList(data) {
    return request({
        url: '/order/list',
        method: 'get',
        params:data
    })
}


export function pDetail(data) {
    return request({
        url: '/product/detail',
        method: 'get',
        params:data
    })
}

export function addProductCategory(data) {
    return request({
        url: '/pcategory/create',
        method: 'post',
        data
    })
}

export function delProductCategory(data) {
    return request({
        url: '/pcategory/delete',
        method: 'post',
        data
    })
}

// 
export function delProduct(data) {
    return request({
        url: '/product/delete',
        method: 'post',
        data
    })
}
export function addProduct(data) {
    return request({
        url: '/product/add',
        method: 'post',
        data
    })
}




export function login(data) {
    return request({
        url: '/user/login',
        method: 'post',
        data
    })
}

export function logout() {
    return request({
        url: '/api/auth/logout',
        method: 'post',
    })
}

export function getUser() {
    return request({
        url: '/api/user',
        method: 'get',
    })
}